using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ImageAnalystTools._MotionImagery
{
    /// <summary>
    /// <para>Extract Video Frames To Images</para>
    /// <para>Extracts video frame images and associated metadata from a FMV-compliant video stream.  The extracted images can be added to a mosaic dataset or other tools and functions for further analysis.</para>
    /// <para>从符合 FMV 的视频流中提取视频帧图像和关联的元数据。 提取的图像可以添加到镶嵌数据集或其他工具和功能中，以便进一步分析。</para>
    /// </summary>    
    [DisplayName("Extract Video Frames To Images")]
    public class ExtractVideoFramesToImages : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ExtractVideoFramesToImages()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_video">
        /// <para>Input Video File</para>
        /// <para>The input video file in any of the supported video file types, including PS, TS, MPG, MPEG, MP2, MPG2, MPEG2, MP4, MPG4, MPEG4, H264, VOB, and M2TS.</para>
        /// <para>任何支持的视频文件类型中的输入视频文件，包括 PS、TS、MPG、MPEG、MP2、MPG2、MPEG2、MP4、MPG4、MPEG4、H264、VOB 和 M2TS。</para>
        /// </param>
        /// <param name="_out_folder">
        /// <para>Output Folder</para>
        /// <para>The file directory where the output images and metadata will be saved.</para>
        /// <para>将保存输出图像和元数据的文件目录。</para>
        /// </param>
        /// <param name="_image_type">
        /// <para>Image Type</para>
        /// <para><xdoc>
        ///   <para>The output image format.</para>
        ///   <bulletList>
        ///     <bullet_item>JPEG—JPEG image format.</bullet_item><para/>
        ///     <bullet_item>TIFF—TIFF image format. This is the default.</bullet_item><para/>
        ///     <bullet_item>NITF—NITF image format.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出图像格式。</para>
        ///   <bulletList>
        ///     <bullet_item>JPEG - JPEG 图像格式。</bullet_item><para/>
        ///     <bullet_item>TIFF - TIFF 图像格式。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>NITF - NITF 图像格式。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public ExtractVideoFramesToImages(object _in_video, object _out_folder, _image_type_value _image_type)
        {
            this._in_video = _in_video;
            this._out_folder = _out_folder;
            this._image_type = _image_type;
        }
        public override string ToolboxName => "Image Analyst Tools";

        public override string ToolName => "Extract Video Frames To Images";

        public override string CallName => "ia.ExtractVideoFramesToImages";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_in_video, _out_folder, _image_type.GetGPValue(), _image_overlap, _require_fresh_metadata.GetGPValue(), _min_time];

        /// <summary>
        /// <para>Input Video File</para>
        /// <para>The input video file in any of the supported video file types, including PS, TS, MPG, MPEG, MP2, MPG2, MPEG2, MP4, MPG4, MPEG4, H264, VOB, and M2TS.</para>
        /// <para>任何支持的视频文件类型中的输入视频文件，包括 PS、TS、MPG、MPEG、MP2、MPG2、MPEG2、MP4、MPG4、MPEG4、H264、VOB 和 M2TS。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Video File")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_video { get; set; }


        /// <summary>
        /// <para>Output Folder</para>
        /// <para>The file directory where the output images and metadata will be saved.</para>
        /// <para>将保存输出图像和元数据的文件目录。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Folder")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_folder { get; set; }


        /// <summary>
        /// <para>Image Type</para>
        /// <para><xdoc>
        ///   <para>The output image format.</para>
        ///   <bulletList>
        ///     <bullet_item>JPEG—JPEG image format.</bullet_item><para/>
        ///     <bullet_item>TIFF—TIFF image format. This is the default.</bullet_item><para/>
        ///     <bullet_item>NITF—NITF image format.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出图像格式。</para>
        ///   <bulletList>
        ///     <bullet_item>JPEG - JPEG 图像格式。</bullet_item><para/>
        ///     <bullet_item>TIFF - TIFF 图像格式。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>NITF - NITF 图像格式。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Image Type")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _image_type_value _image_type { get; set; }

        public enum _image_type_value
        {
            /// <summary>
            /// <para>JPEG</para>
            /// <para>JPEG—JPEG image format.</para>
            /// <para>JPEG - JPEG 图像格式。</para>
            /// </summary>
            [Description("JPEG")]
            [GPEnumValue("JPEG")]
            _JPEG,

            /// <summary>
            /// <para>TIFF</para>
            /// <para>TIFF—TIFF image format. This is the default.</para>
            /// <para>TIFF - TIFF 图像格式。这是默认设置。</para>
            /// </summary>
            [Description("TIFF")]
            [GPEnumValue("TIFF")]
            _TIFF,

            /// <summary>
            /// <para>NITF</para>
            /// <para>NITF—NITF image format.</para>
            /// <para>NITF - NITF 图像格式。</para>
            /// </summary>
            [Description("NITF")]
            [GPEnumValue("NITF")]
            _NITF,

        }

        /// <summary>
        /// <para>Maximum Overlap Percentage</para>
        /// <para>The maximum overlap percentage between two images. If the overlap between a candidate image and the last image written to disk is greater than this value, the candidate image will be ignored. The default percentage is 100%, which writes all images to disk.</para>
        /// <para>两个图像之间的最大重叠百分比。如果候选映像与写入磁盘的最后一个映像之间的重叠大于此值，则将忽略候选映像。默认百分比为 100%，将所有映像写入磁盘。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Overlap Percentage")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _image_overlap { get; set; } = 100;


        /// <summary>
        /// <para>Require Fresh Metadata</para>
        /// <para><xdoc>
        ///   <para>Specifies whether video frames with associated metadata will be extracted and saved.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Only video frames with associated metadata will be saved.</bullet_item><para/>
        ///     <bullet_item>Unchecked—All video frames will be saved. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否提取和保存具有关联元数据的视频帧。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 仅保存具有关联元数据的视频帧。</bullet_item><para/>
        ///     <bullet_item>未选中 - 将保存所有视频帧。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Require Fresh Metadata")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _require_fresh_metadata_value _require_fresh_metadata { get; set; } = _require_fresh_metadata_value._false;

        public enum _require_fresh_metadata_value
        {
            /// <summary>
            /// <para>REQUIRE_FRESH_METADATA</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("REQUIRE_FRESH_METADATA")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_REQUIRE_FRESH_METADATA</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_REQUIRE_FRESH_METADATA")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Minimum Time Between Features</para>
        /// <para>The minimum time interval between video frames to be saved. If this is not specified, all video frames will be saved as images.</para>
        /// <para>要保存的视频帧之间的最小时间间隔。如果未指定，则所有视频帧都将保存为图像。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Time Between Features")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _min_time { get; set; } = null;


        public ExtractVideoFramesToImages SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}